package com.ziyia.a274;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.ViewFlipper;

public class MainActivity extends AppCompatActivity {

    ViewFlipper viewFlipper;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        viewFlipper = findViewById(R.id.datails);


    }
    public void prev(View view) {
        viewFlipper.setInAnimation(this, R.anim.slide_in_right);
        viewFlipper.setInAnimation(this, R.anim.slide_in_left);

        viewFlipper.showPrevious();
        viewFlipper.stopFlipping();
    }
    public void next(View view) {
        viewFlipper.setInAnimation(this, R.anim.slide_in_right);
        viewFlipper.setInAnimation(this, R.anim.slide_in_left);

        viewFlipper.showNext();
        viewFlipper.stopFlipping();

    }

    public void auto(View view) {

        viewFlipper.setInAnimation(this, R.anim.slide_in_right);
        viewFlipper.setInAnimation(this, R.anim.slide_in_left);

        viewFlipper.startFlipping();

    }


}